<?php


class Adept_Validate_Number extends Adept_Validate_Abstract implements Adept_Validate_IValidator
{

    public function validate($sender, $value)
    {
        if (preg_match("/\d+$/", trim($value))) {
            return ;
        } else {
            $title = ($sender instanceof Adept_Component_Control) ? $sender->getTitle() : '';
            
            throw new Adept_Validate_Exception('NOT_VALID_NUMBER', 0, 
                array(
                    'value' => $value, 
                    'field' => $title,
                )
            );
        }
    }

    public function setAttributes($attrs)
    {

    }

}